<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<script type="text/javascript">
function changenotice() {
	var ids = '';
	var count = 0;
	var status = '';
	$('input:checkbox[name="ids"]:checked',navTab.getCurrentPanel()).each(function(i, n) {
		ids = n.value;
		count += count+1;
		status = $(this).attr("status");
	});
	if(count == 0) {
		alert('请选择你要修改的信息！');
		return ;
	}
	else if(count > 1) {
		alert('只能选择一条信息进行修改！');
		return ;		
	}
	else {
		if(status == '1011701') {
		 	var navTabId = navTab._getTabs().filter('.selected').attr('tabid');
			navTab.openTab("listnotice", "../resource/noticeAction!modifyNoticeAll.action?id="+ids+"&navTabId="+navTabId, { title:"修改", fresh:false, data:{} });
		}
		else {
			alert('只有已发布的信息才能修改！');
			return ;
	    }
	}
}


</script>
<div class="tip"><span>查询</span></div>
<div class="pageHeader">
	<form onsubmit="if(this.action != '${path }/resource/noticeAction!listNotice.action'){this.action = '${path }/resource/noticeAction!listNotice.action' ;} ;return navTabSearch(this);" action="${ path }/resource/noticeAction!listNotice.action" method="post" rel = "pagerForm" id="pagerFindForm">
	<div class="searchBar">
		<table class="pageFormContent">
				 <tr>
				  <td>
					<label>标题：</label><input type="text" name="filter_and_title_LIKE_S" value="${filter_and_title_LIKE_S }"/>
				</td>
				 <td>
					<label>发布人：</label><input type="text" name="filter_and_releasePerson_LIKE_S" value="${filter_and_releasePerson_LIKE_S }"/>
				</td>
				<td>
					<label>类别：</label>
					<select name="filter_and_type_EQ_S" value="${notice.type }" rel="iselect" loadUrl="${path}/hpin/sysDictType!treeRegion.action?defaultID=10518">
						<option value="${ filter_and_type_EQ_S }"></option>	
					</select>
				</td>
				 </tr>
				 <tr>
				 <td>
				<label>创建日期：</label>
				<input type="text" name="filter_and_createTime_GEST_T"  id="d1" style="width: 170px;" onFocus="WdatePicker({minDate:'2000-01-01',maxDate:'#F{$dp.$D(\'d2\')}'})"  readonly="readonly" value="${filter_and_noticecreateTime_GEST_T}" /><a class="inputDateButton" href="javascript:;" >选择</a>
			</td>
			<td>
				<label>至：</label>
				<input type="text" name="filter_and_createTime_LEET_T" id="d2" style="width: 170px;" onFocus="WdatePicker({minDate:'#F{$dp.$D(\'d1\')}'})"  readonly="readonly" value="${filter_and_createTime_LEET_T}" /><a class="inputDateButton" href="javascript:;">选择</a>
			</td>
					<td>
					<div class="buttonActive"><div class="buttonContent"><button type="submit">查找</button></div></div>
					<div class="buttonActive"><div class="buttonContent"><button type="button" id="clearText">重置</button></div></div>
					</td>
				</tr>
		</table>
	</div>
	</form>
</div>
<div class="pageContent">
	<div class="panelBar">
	<web:security tag="noticeAdmin">
		<ul class="toolBar">
			<li><a class="add" href="${path }/resource/noticeAction!addNotice.action" target="navTab"><span>添加</span></a></li>
			<li><a class="delete" href="${path }/resource/noticeAction!deleteNotice.action" rel="ids" postType="string" title="确定要删除吗?" target="selectedTodo"><span>删除</span></a></li>
			<li><a class="edit" onclick="changenotice()" style="cursor:pointer;"><span>修改</span></a></li>
			<%--<li><a class="edit" href="${path }/resource/noticeAction!modifyNoticeAll.action?id={sid_user}" target="navTab"><span>修改1</span></a></li>--%>
			<web:exportExcelTag 
					pagerFormId="pagerFindForm" 
					pagerMethodName="findByPage" 
					actionAllUrl="org.xyxy.scientificResearch.web.NoticeAction" 
					informationTableId="exportExcelTable"
					fileName="notice"></web:exportExcelTag>
		</ul>
	</web:security>
		<jsp:include page="/common/pagination.jsp" />	
	</div>
	<table class="list" width="100%" layoutH="160" id="exportExcelTable">
		<thead>
			<tr>
				<th>序号</th>
				<th nowrap="nowrap" export = "true" columnEnName = "title" columnChName = "标题" >标题</a></th>
				<th nowrap="nowrap" export = "true" columnEnName = "releasePerson" columnChName = "发布人" >发布人</a></th>
				<th nowrap="nowrap" export = "true" columnEnName = "type" columnChName = "类别" >类别</th>
		        <th nowrap="nowrap" export = "true" columnEnName = "releaseTime" columnChName = "发布日期" ><nobr><a href="javascript:navSort('order_releaseTime','desc');">发布日期</a></nobr></th>
				<th nowrap="nowrap" export = "true" columnEnName = "createUserId" columnChName = "创建人" >创建人</a></th>
				<th nowrap="nowrap" export = "true" columnEnName = "updateUserId" columnChName = "修改人" >修改人</a></th>
				<th nowrap="nowrap" export = "true" columnEnName = "updateTime" columnChName = "修改时间" >修改时间</th>
				<th nowrap="nowrap">操作</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${ page.results }" var="notice" varStatus="status">
			<tr target="sid_user" rel="${ notice.id }">
				<td align="center"><input type="checkbox" name="ids" value="${ notice.id }" status="${ notice.status }">${ status.count }</td>
				<td><a href="${ path }/resource/noticeAction!browNoticeAll.action?id=${ notice.id }" width="800" height="480" style="color:#0000FF" target="dialog" title="${notice.title }">${fn:substring(notice.title,0,18) }</a></td>
				<td  align="center" nowrap="nowrap">${notice.releasePerson}</td>
				<td  align="center" nowrap="nowrap"><hpin:id2nameDB id='${notice.type}' beanId='org.hpin.base.dict.dao.SysDictTypeDao'/></td>
				<td  align="center" nowrap="nowrap"><fmt:formatDate value="${notice.releaseTime}" pattern="yyyy-MM-dd" /> </td>
				<td  align="center" nowrap="nowrap"><hpin:id2nameDB id='${notice.createUserId}' beanId='org.hpin.base.usermanager.dao.UserDao'/></td>
				<td  align="center" nowrap="nowrap"><hpin:id2nameDB id='${notice.updateUserId}' beanId='org.hpin.base.usermanager.dao.UserDao'/></td>
				<td align="center" nowrap="nowrap"><fmt:formatDate value="${notice.updateTime }" pattern="yyyy-MM-dd HH:mm:ss" /></td>
				<td align="center" nowrap="nowrap">
				 <web:security tag="noticeAdmin">
				  <c:if test="${notice.status eq '1011701'}">
					<a href="${path }/resource/noticeAction!modifyNoticeAll.action?id=${ notice.id }" target="navTab"><span>修改</span></a>
				  </c:if>
				 </web:security> 
				</td>
				
				
		</c:forEach>
		</tbody>
	</table>
</div>
